package com.ruoyi.production.service.impl.carton;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.carton.CartonPurchaseApply;
import com.ruoyi.production.mapper.carton.CartonPurchaseApplyMapper;
import com.ruoyi.production.service.carton.ICartonPurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 纸箱购买申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class CartonPurchaseApplyServiceImpl implements ICartonPurchaseApplyService
{
    @Autowired
    private CartonPurchaseApplyMapper cartonPurchaseApplyMapper;

    /**
     * 查询纸箱购买申请
     *
     * @param cartonPurchaseApplyId 纸箱购买申请ID
     * @return 纸箱购买申请
     */
    @Override
    public CartonPurchaseApply selectCartonPurchaseApplyById(Long cartonPurchaseApplyId)
    {
        return cartonPurchaseApplyMapper.selectCartonPurchaseApplyById(cartonPurchaseApplyId);
    }

    /**
     * 查询纸箱购买申请列表
     *
     * @param cartonPurchaseApply 纸箱购买申请
     * @return 纸箱购买申请
     */
    @Override
    public List<CartonPurchaseApply> selectCartonPurchaseApplyList(CartonPurchaseApply cartonPurchaseApply)
    {
        return cartonPurchaseApplyMapper.selectCartonPurchaseApplyList(cartonPurchaseApply);
    }

    /**
     * 新增纸箱购买申请
     *
     * @param cartonPurchaseApply 纸箱购买申请
     * @return 结果
     */
    @Override
    public int insertCartonPurchaseApply(CartonPurchaseApply cartonPurchaseApply)
    {
        cartonPurchaseApply.setCreateTime(DateUtils.getNowDate());
        return cartonPurchaseApplyMapper.insertCartonPurchaseApply(cartonPurchaseApply);
    }

    /**
     * 修改纸箱购买申请
     *
     * @param cartonPurchaseApply 纸箱购买申请
     * @return 结果
     */
    @Override
    public int updateCartonPurchaseApply(CartonPurchaseApply cartonPurchaseApply)
    {
        cartonPurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return cartonPurchaseApplyMapper.updateCartonPurchaseApply(cartonPurchaseApply);
    }

    /**
     * 批量删除纸箱购买申请
     *
     * @param cartonPurchaseApplyIds 需要删除的纸箱购买申请ID
     * @return 结果
     */
    @Override
    public int deleteCartonPurchaseApplyByIds(Long[] cartonPurchaseApplyIds)
    {
        return cartonPurchaseApplyMapper.deleteCartonPurchaseApplyByIds(cartonPurchaseApplyIds);
    }

    /**
     * 删除纸箱购买申请信息
     *
     * @param cartonPurchaseApplyId 纸箱购买申请ID
     * @return 结果
     */
    @Override
    public int deleteCartonPurchaseApplyById(Long cartonPurchaseApplyId)
    {
        return cartonPurchaseApplyMapper.deleteCartonPurchaseApplyById(cartonPurchaseApplyId);
    }
}
